Skip to content

feat(directory-browser): add custom dialog for project and folder select#45

Merged
tyulyukov merged 1 commit into
mainfrom
feature/directory-browser
Apr 20, 2026
Merged

feat(directory-browser): add custom dialog for project and folder select#45
tyulyukov merged 1 commit into
mainfrom
feature/directory-browser

Conversation

@tyulyukov
Copy link
Copy Markdown
Owner

Summary

  • Created reusable DirectoryBrowserDialog component for browsing and selecting directories

    • Supports navigation via breadcrumbs, up/parent navigation, and home shortcut
    • Includes filtering by folder name with case-insensitive search
    • Keyboard-driven (arrow keys, Enter to select, Backspace to go up)
    • Double-click and single-click to navigate into folders
    • Ctrl/Cmd+Enter to confirm current directory
  • Implemented browseDirectories() backend function in workspaceEntries.ts

    • Expands home paths (~ and ~/)
    • Resolves relative paths (../) relative to cwd
    • Returns resolved parent directory alongside entries
    • Gracefully handles missing directories
  • Refactored "Add Project" flow in Sidebar to use directory browser dialog

    • Removed inline folder picking logic and native OS picker dependency
    • Replaced inline form with centralized dialog component
    • Simplifies state management (removed separate form state)
  • Refactored "Add Folder" flow in ComposerAttachmentsPopover to use directory browser dialog

    • Opens browser at parent of project directory (../) for convenience
    • Maintains consistent UX with "Add Project" flow
  • Added addProjectBaseDirectory setting to persist last used directory

    • Dialog initializes to this directory or home if not set
    • Updated server settings schema and tests

Testing

  • Unit tests for browseDirectories() covering:

    • Basic directory listing with relative paths
    • Absolute path resolution regardless of cwd
    • Home directory expansion (~/)
    • Relative path resolution (../)
    • Graceful handling of missing directories
  • Integration test for settings persistence of addProjectBaseDirectory

  • Integration guard test added for directory browser wiring

  • Manual testing: both "Add Project" and "Add Folder" flows use dialog successfully

- Add DirectoryBrowserDialog component with breadcrumb navigation, filtering, and keyboard shortcuts
- Implement browseDirectories server endpoint for listing directory contents
- Replace native picker with custom dialog in add project and add folder flows
- Add addProjectBaseDirectory setting to remember last project path
- Simplify Sidebar state management by consolidating add-project logic
- Support keyboard shortcuts (↑/↓ to navigate, Enter to select, Backspace/Cmd+Enter for navigation)
- Add integration guard test for directory browser
@tyulyukov tyulyukov merged commit 0754390 into main Apr 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant